import {create} from 'zustand'
import {persist } from 'zustand/middleware'
interface Obj {
    id: string,
    title:string,
    path:string,
    icon:string,
    parentId:string
  }
interface AuthState{
    menu:Obj[],
    setmenu:(i:Obj[])=>void
}
export const useAuthStore=create(
    persist(
        (set)=>({
            menu:[],
            setmenu:(i:Obj[])=>set({menu:i})
        }),
        {
            name:'auth-storage',
            partialize:(state:AuthState)=>({menu:state.menu})
        }
    )
)